package com.example.demo.mapper;

import com.example.demo.entity.econ.AreaData;
import com.example.demo.entity.econ.MapData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EconMapper {

    @Select("select round(year2021) as value,province as name from cityIncome group by province;")
    List<MapData> getCityMap();

    @Select("select round(year2021) as value,province as name from countryIncome group by province;")
    List<MapData> getCountryMap();

    @Select("select avg(year2015) as year2015, avg(year2016) as year2016, avg(year2017) as year2017, avg(year2018) as year2018, avg(year2019) as year2019, avg(year2020) as year2020, avg(year2021) as year2021 from income where area='西北' group by kind;")
    List<AreaData> xiBei();

    @Select("select avg(year2015) as year2015, avg(year2016) as year2016, avg(year2017) as year2017, avg(year2018) as year2018, avg(year2019) as year2019, avg(year2020) as year2020, avg(year2021) as year2021 from income where area='东北' group by kind;")
    List<AreaData> dongBei();

    @Select("select avg(year2015) as year2015, avg(year2016) as year2016, avg(year2017) as year2017, avg(year2018) as year2018, avg(year2019) as year2019, avg(year2020) as year2020, avg(year2021) as year2021 from income where area='华北' group by kind;")
    List<AreaData> huaBei();

    @Select("select avg(year2015) as year2015, avg(year2016) as year2016, avg(year2017) as year2017, avg(year2018) as year2018, avg(year2019) as year2019, avg(year2020) as year2020, avg(year2021) as year2021 from income where area='华东' group by kind;")
    List<AreaData> huaDong();

    @Select("select avg(year2015) as year2015, avg(year2016) as year2016, avg(year2017) as year2017, avg(year2018) as year2018, avg(year2019) as year2019, avg(year2020) as year2020, avg(year2021) as year2021 from income where area='中南' group by kind;")
    List<AreaData> zhongNan();

    @Select("select avg(year2015) as year2015, avg(year2016) as year2016, avg(year2017) as year2017, avg(year2018) as year2018, avg(year2019) as year2019, avg(year2020) as year2020, avg(year2021) as year2021 from income where area='西南' group by kind;")
    List<AreaData> xiNan();

}
